<script type="text/javascript">
    $(function(){
        $("select[data-edit-select]").filterSelect();
    });
    function submitF(){
        var filename=$('#filename').val();
        var title= $.trim($('#title').val());
        if(filename==''){
            alert('请选择文件');
            return false;
        }
        if(title==''){
            alert('请输入标题');
            return false;
        }
    }
</script>
<!--菜单 start-->
<?php $this->load->view('defaults/common/left');?>
<!--菜单 end-->
<div id="content">
    <div class="page-header">
        <div class="container-fluid">
          <h1><?=lang('menu_maintain_report')?></h1>
          <?=$this->breadcrumb->generateHTML();?>
        </div>
    </div>
    <div class="container-fluid">
        <div class="panel panel-default">
          <div class="panel-heading">
            <h3 class="panel-title"><i class="fa fa-list"></i>维修数据</h3>
          </div>
          <div class="panel-body">
            <div class="well" style="padding:0 19px;">
              <div class="row">
                <form action="<?=blang_url('maintainReport/maintainReport/uploadFile')?>" method="post" enctype="multipart/form-data">
                    <div class="col-sm-4">
                        <div class="form-group">
                            <label class="control-label">客户</label>
                            <select class="form-control" name="client_id" data-edit-select="1">
                                <?php foreach($platformClineList as $row){?>
                                    <option value="<?=$row['id']?>" ><?=$row['name']?></option>
                                <?php }?>
                            </select>
                        </div>
                    </div>
                     <div class="col-sm-4">
                        <div class="form-group">
                            <label class="control-label">标题</label>
                            <input class="form-control" type="text" id="title" name="title">
                        </div>
                    </div>
                    <div class="col-sm-4">
                        <div class="form-group">
                            <label class="control-label">文件</label>
                            <input class="form-control" type="file" name="filename" id="filename">
                        </div>
                        <input class="btn btn-primary pull-right" style="margin-bottom: 19px;" type="submit" onclick="return submitF()" value=" 提 交 ">
                    </div>
                </form>
              </div>
            </div>
            <div class="well" style="padding:0 19px;">
              <div class="row">
                <form action="<?=blang_url('maintainReport/maintainReport/dataUploadList')?>" method="post">
                    <div class="col-sm-4">
                        <div class="form-group">
                            <label class="control-label">客户</label>
                            <select class="form-control" name="client_id" data-edit-select="1" style="width: 400px;">
                                <option value="">-全部-</option>
                                <?php foreach($platformClineList as $row){?>
                                    <option value="<?=$row['id']?>"><?=$row['name']?></option>
                                <?php }?>
                            </select>
                        </div>
                    </div>
                    <div class="col-sm-4">
                        <div class="form-group">
                            <label class="control-label">标题</label>
                            <input class="form-control" type="text" id="title" name="title">
                        </div>
                    </div>
                    <div class="col-sm-4">
                        <div class="form-group" style="padding-top:37px;">
                            <input class="btn btn-primary" type="submit" value=" 查 询 ">
                        </div>
                    </div>
                </form>
              </div>
            </div>
            <div class="table-responsive">
                <table class="table table-bordered table-hover oms-table">
                  <thead>
                    <tr>
                        <th class="text-left">客户</th>
                        <th class="text-left">文件标题</th>
                        <th class="text-right" style="width:10%;">操作</th>
                    </tr>
                  </thead>
                  <tbody>
                    <?php if($repairFile): foreach ($repairFile as $key=>$row):?>
                    <tr>
                        <td><?=$row['name']?></td>
                        <td><?=$row['title']?></td>
                        <td><a class="btn btn-oms btn-sm"  href="<?=$row['filename']?>"><i class="fa fa-download"></i>&nbsp;下载</a></td>
                    </tr>
                    <?php endforeach; else:?>
                        <tr><td colspan="3" class="emptyNumber"><?=lang('public_mygdsj')?>....</td></tr>
                    <?php endif; ?>
                </tbody>
                </table>
                <?php if($show_pages):?>
                <div class="page">
                    <?=$show_pages?>
                </div>
                <?php endif;?>
            </div>
          </div>
        </div>
    </div>

</div>
